package schema

import (
	"entgo.io/ent"
	"entgo.io/ent/dialect/entsql"
	"entgo.io/ent/schema"
	"entgo.io/ent/schema/field"

	cent "gitee.com/shuokeyun/common/ent"
)

type MerchantCertification struct {
	ent.Schema
}

func (MerchantCertification) Mixin() []ent.Mixin {
	return []ent.Mixin{
		cent.OrmMixin{},
	}
}

func (MerchantCertification) Annotations() []schema.Annotation {
	return []schema.Annotation{
		entsql.Annotation{
			Table: "sk_merchant_certification",
		},
	}
}

func (MerchantCertification) Fields() []ent.Field {
	return []ent.Field{
		field.String("legal_person").Default("").Comment("法人姓名"),
		field.String("legal_person_card_id").Default("").Comment("法人身份证号"),
		field.String("legal_person_identity_front_side").Default("").Comment("法人身份证照片正面"),
		field.String("legal_person_identity_back_side").Default("").Comment("法人身份证照片反面"),
		field.String("business_license").Default("").Comment("营业执照统一社会信用代码"),
		field.String("business_license_photo").Default("").Comment("营业执照照片"),
		field.Time("business_license_start_date").Optional().Comment("营业执照开始日期"),
		field.Time("business_license_end_date").Optional().Comment("营业执照结束日期"),
		field.String("medical_license").Default("").Comment("医疗许可证登记号"),
		field.String("medical_license_name").Default("").Comment("医疗机构执照名称"),
		field.String("medical_license_photo").Default("").Comment("医疗机构执业许可证照片"),
		field.Time("medical_license_start_date").Optional().Comment("医疗机构执业许可证有效期限开始日期"),
		field.Time("medical_license_end_date").Optional().Comment("医疗机构执业许可证有效期限结束日期"),
		field.Int8("is_nonprofit").Default(0).Comment("是否非营利 1是;2否"),
		field.Int8("property").Default(1).Comment("性质 1私立;2公立;3CRO"),
		field.String("drug_license").Default("").Comment("药品经营许可证"),
		field.String("drug_license_photo").Default("").Comment("药品经营许可证照片"),
		field.String("contract_photo").Default("").Comment("合同照片"),
		field.Time("contract_start_date").Optional().Comment("合同开始日期"),
		field.Time("contract_end_date").Optional().Comment("合同结束日期"),
	}
}
